import React, { Component } from 'react'
import { Row, Col} from 'antd'
import './index.less'
import { withRouter } from 'react-router-dom'
import Header from '../../components/Header'
import Footer from '../../components/Footer'

class Home extends Component {

  componentWillMount() {
    if (!window.localStorage.getItem('userInfo')) {
      this.props.history.push('/login');
    }
  }

  render() {
    return (
      <Row className="home">
        <Col span={3}>
          
        </Col>
        <Col span={18} className="home-body">
          <Header></Header>
          <section className="home-content">
            {this.props.children}
          </section>
          <Footer></Footer>
        </Col>
        <Col span={3}>

        </Col>
      </Row>
    )
  }
}

export default withRouter(Home);
